<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/26
 * Time: 10:36
 */

namespace app\api\model;


use think\Model;

class BaseModel extends Model
{

    protected $hidden = ['delete_time','update_time','topic_img_id','head_img_id'];
    protected $autoWriteTimestamp = true;

    /**
     * @param $value
     * @param $data
     * @return string
     */
    public function getUrl($value,$data){

        if($data['from']==1){
            return config('img_prefix').$value;
        }else{
            return $value;
        }

    }

}